<?
	include "conexao.php" ;
	$nrped = $_COOKIE["pedido"] ;

	$stgsql = $conec->prepare("select a.nome, a.valor ,b.codigo, b.numero
							   from PIZZAS a, PEDIDOS b
							   where  a.codigo= b.codigo and b.numero=:nrped");  
	
	$stgsql->execute(array(':nrped' => "$nrped"));
	$valortotal = 0 ;
  
	while ($dados = $stgsql->fetch()) 
	{  
		$nompizza = $dados['nome'] ;
		$valorpizza = $dados['valor'] ;
		$codigo =  $dados['codigo'];
		$numero=$dados['numero'];
		$valortotal += $valorpizza ;
		
		echo "<tr>" ;
		echo " <td><font size='2' face='Arial, Helvetica, sans-serif'>$nompizza</font></td>" ;
		echo " <td><font size='2' face='Arial, Helvetica, sans-serif'>$valorpizza</font></td>" ;
		echo "<td><font size='2' face='Arial, Helvetica, sans-serif'><a href = 'excluiitem.php?&nped=$numero;&id2=$codigo'><img src='imagens/deleted.gif' alt='exluir pizza'></font></td></a>";
		echo "</tr>" ;
	}

	echo "<tr> " ;
	echo " <td><font size='2' face='Arial, Helvetica, sans-serif'></font></td>" ;
	echo " <td><font size='2' face='Arial, Helvetica, sans-serif'></font></td>" ;
	echo "</tr>" ;
	echo "<tr bgcolor='#CCCCCC'>" ;
	echo "  <td><b><font size='2' face='Arial, Helvetica, sans-serif'>Total</font></b></td>" ;
	echo "  <td><b><font size='2' face='Arial, Helvetica, sans-serif'>$valortotal</font></b></td>" ;
	echo "</tr>" ;
?>